<?php
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE);

header('Content-Type:text/html; charset=utf-8');

require 'lib/common.inc.php';
$filelist = getFileListByDir('./demo', ['php', 'htm', 'html']);
//print_r($filelist);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JS</title>
</head>
<body>
<h1>JS</h1>
<table width="100%" border="0" cellpadding="2" cellspacing="1">
<?php
	foreach($filelist as $k => $v){
		$ctt = file_get_contents('demo/'.$v);
		if($v == "index.php")continue;
		preg_match("/<title>([\s\S]*?)<\/title>/i", $ctt, $matches);
		echo "<tr bgcolor=#DFDFDF>";
		echo ' <td width=120><a href="demo/'.$v.'" target="_blank"> '.$v."</a></td><td>　".$matches[1]."</td>";
		echo "</tr>";
	}
?>
</table>
</body>
</html>